package com.googlecode.intellimars.sabotter;

import com.intellij.util.net.HttpConfigurable;

public class SabotterConfig {
    private static final String DEFAULT_URL = "http://twitter.com/";
    private String username;
    private String password;
    private String serverUrl = DEFAULT_URL;
    private int interval = 60;
    private boolean autoSignin;
    private String fontFamily = "SanSerif";
    private int fontSize = 10;
    private boolean useProxy;

    public SabotterConfig() {
        HttpConfigurable httpConfigurable = HttpConfigurable.getInstance();
        useProxy = httpConfigurable.USE_HTTP_PROXY;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(final String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(final String password) {
        this.password = password;
    }

    public String getServerUrl() {
        return serverUrl;
    }

    public void setServerUrl(final String serverUrl) {
        this.serverUrl =  serverUrl == null || "".equals(serverUrl) ? DEFAULT_URL : serverUrl;
    }

    public int getInterval() {
        return interval;
    }
    public void setInterval(int interval) {
        this.interval = interval;
    }

    public boolean isAutoSignin() {
        return autoSignin;
    }
    public void setAutoSignin(boolean autoSignin) {
        this.autoSignin = autoSignin;
    }

    public String getFontFamily() {
        return fontFamily;
    }
    public void setFontFamily(String fontFamily) {
        this.fontFamily = fontFamily;
    }

    public int getFontSize() {
        return fontSize;
    }
    public void setFontSize(int fontSize) {
        this.fontSize = fontSize;
    }

    public String toString() {
        return "SabotterConfig{" +
                "username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", interval='" + interval + '\'' +
                '}';
    }

    public boolean isUseProxy() {
        return useProxy;
    }

    public void setUseProxy(boolean selected) {
        useProxy = selected;
    }
}